{extend name="base/common"}

{block name="style"}
<link rel="stylesheet" href="__STATIC__/datepicker/bootstrap-datetimepicker.min.css">
<link rel="stylesheet" href="__STATIC__/iCheck/custom.css">
<link rel="stylesheet" href="__ADMIN__/css/chosen/chosen.css">
{/block}

{block name="page-header"}
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>通讯录</h2>
        <ol class="breadcrumb">
            <li>
                <a href="{:Url('Wechat/department')}">用户信息</a>
            </li>
            <li class="active">
                <strong>详情</strong>
            </li>
        </ol>
    </div>
    <div class="col-lg-2">

    </div>
</div>
{/block}

{block name="main"}
<div class="wrapper wrapper-content animated fadeInRight ">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>详情页面</h5>
                    <div class="ibox-tools">
                        <a href="javascript:window.history.go(-1);" class="btn btn-white btn-sm"><i class="fa fa-reply"></i> 返回</a>
                    </div>
                </div>
                <div class="ibox-content all">
                    <form id="form" class="form-horizontal" method="post" enctype="multipart/form-data">
                        <!--名称-->
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label>微信账号:</label>
                            </div>
                            <div class="col-lg-11">
                                <input type="text"  class="form-control form_title"  value="{$info.openid}" disabled>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label>昵称:</label>
                            </div>
                            <div class="col-lg-11">
                                <input type="text"  class="form-control form_title"  value="{$info.nickname}" disabled>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label>姓名:</label>
                            </div>
                            <div class="col-lg-11">
                                <input type="text"  class="form-control form_title" name="name" value="{$info.name}" {empty name="$info.name"} disabled {/empty}>
                            </div>
                        </div>
                        <!--性别-->
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label>性别:</label>
                            </div>
                            <div class="col-lg-11">
                                <select class="form-control"  disabled>
                                    <option value="1" {eq name="$info.sex" value="1"}selected{/eq}>男</option>
                                    <option value="2" {eq name="$info.sex" value="2"}selected{/eq}>女</option>
                                </select>
                            </div>
                        </div>
                        <!--手机号-->
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label>手机号码:</label>
                            </div>
                            <div class="col-lg-11">
                                <input type="text"  maxlength="11" class="form-control  form_title"  name= 'tel' value="{$info.tel}" disabled>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label>VIP账号:</label>
                            </div>
                            <div class="col-lg-11">
                                <input type="text"  class="form-control form_title"  value="{$info.order_id}" disabled>
                            </div>
                        </div>
                        <!--党员-->
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label>是否认证:</label>
                            </div>
                            <div class="col-lg-11" >
                                <label class="i-checks">
                                    <input type="radio"  {eq name="info.review_status" value="0"} disabled {/eq} value="1" name="review_status" {eq name="$info.review_status" value="1"}checked{/eq}>是
                                </label>
                                <label class="i-checks">
                                    <input type="radio"  {eq name="info.review_status" value="0"} disabled {/eq} value="0" name="review_status" {eq name="$info.review_status" value="0"}checked{/eq}>否
                                </label>
                            </div>
                        </div>
                        <input type="hidden" name="id" value="{$info.id}">
                        <div class="form-group">
                            <div class="col-lg-11 col-lg-offset-1">
                                <button class="btn btn-primary submit-btn post-add" type="button" target-form="form-horizontal">发布</button>
                                <a class="btn btn-default" href="javascript:window.history.go(-1);">返回</a>
                            </div>
                        </div>

                        <div class="selblo"></div>

                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}

{block name="script"}
<script src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<script src="__STATIC__/iCheck/icheck.min.js"></script>
<script src="__STATIC__/ueditor/ueditor.config.js"></script>
<script src="__STATIC__/ueditor/ueditor.all.min.js"></script>
<script src="__ADMIN__/js/chosen.jquery.js"></script>
<script>
    //    单选按钮
    $('.i-checks').iCheck({
        checkboxClass: 'icheckbox_square-green',
        radioClass: 'iradio_square-green'
    });
    //导航高亮
    highlight_subnav("{:Url('Wechat/user')}");
    //数据提交
    $('.post-add').click(function(){
        var data ={};
        data.id = $("input[name='id']").val();
        data.tel = $("input[name='tel']").val();
        data.name= $("input[name='name']").val().trim(); //名称
        data.review_status = $("input[name='review_status']:checked").val();
        //验证判断
        if(!data.name){
            warning({msg: "名称不能为空"});
            return '';
        }
        var it = $(this);
        $.ajax({
            type: 'post',
            url: "{:Url('wechat/detail')}",
            data: data,
            success: function(data){
                it.prop('disabled','true');
                it.next('button').prop('disabled','true');
                if(data.code == 1){
                    updateAlert(data.msg + ' 页面即将自动跳转~','success');
                    setTimeout(function(){
                        location.href = "{:Url('Wechat/user')}";
                        it.removeAttr('disabled');
                        it.next('button').removeAttr('disabled')
                    },2000);
                }else{
                    updateAlert(data.msg + '','error');
                    setTimeout(function(){
                        it.removeAttr('disabled');
                        it.next('button').removeAttr('disabled')
                    },1000);
                }
            }
        })
    })
</script>
{/block}